Tool Mentor: Stubs And Drivers
Relationships
Main Description
A system is generally tested in parts. A part may be a module or component. To test a module that has relationships with modules not yet realised at an early stage, you need stubs and drivers that replace the missing modules. A stub is accessed from the module to be tested, a driver accesses the module to be tested (see figure 1 - Stubs and drivers in relation to module A and module B).


Figure 1: stubs and drivers in relation to module A and module B

A reporting function that prints the payroll per employee is tested. In this function, the payroll calculating program (tested earlier) is accessed. The test aims to select all employees and print the payroll for every employee. However, preparing a test database with all of the required data for the various payroll calculations can be a huge task. A stub that returns a specific salary amount (e.g. based on the entered employee number) can significantly reduce the test effort. Naturally, the relationship between the real programs must always be tested once.